#ifndef TC_TOY_H
#define TC_TOY_H

#ifdef JMBC_INSIDE

#include <GL/gl.h>
#include <ode/ode.h>

typedef struct
{
	float speed;
	float steer;
	int turbo;
	dBodyID bodies[5];
	dGeomID geoms[5];
	dJointID joints[4];
	unsigned int meshes[2];
	ALuint engine;
} TCToy;

#endif

// Context

void
tcToyCreateContext(void);

// Generation / Deletion

void
tcGenToys(unsigned int n, unsigned int *toys);

void
tcDeleteToys(unsigned int n, unsigned int *toys);

// Load / Unload

void
tcToyLoad(unsigned int id, unsigned int name, unsigned int color, const float *position);

void
tcToyUnload(unsigned int id);

void
tcToysUnload(unsigned int n, unsigned int *toys);

// Query

void
tcToyFrame(unsigned int id);

void
tcToyEnable(unsigned int id);

void
tcToyDisable(unsigned int id);

int
tcToyIsEnabled(unsigned int id);

void
tcToyPause(unsigned int id);

void
tcToyPlay(unsigned int id);

const float *
tcToyGetPosition(unsigned int id);

const float *
tcToyGetRotation(unsigned int id);

const float *
tcToyGetLinearVel(unsigned int id);

void
tcToyDrive(unsigned int id, int up, int down, int left, int right);

void
tcToyTurbo(unsigned int id);

void
tcToyUnturbo(unsigned int id);

void
tcToyJump(unsigned int id);

void
tcToyPlace(unsigned int id, const float *position, const float *rotation);

#endif
